﻿namespace Nintest.Tests.Collections
{
    using Nintest.Collections;

    using NUnit.Framework;

    [TestFixture]
    public class GroupingTests
    {
        [Test]
        public void Key()
        {
            var expectedKey = new object();
            var grouping = new Grouping<object, object>(expectedKey);

            var actualKey = grouping.Key;

            Assert.That(actualKey, Is.SameAs(expectedKey));
        }

        // ReSharper disable UseObjectOrCollectionInitializer
        [Test]
        public void Add()
        {
            var expectedElement = new object();
            var expectedEnumerable = new[] { expectedElement };
            var grouping = new Grouping<int, object>(1);

            grouping.Add(expectedElement);

            Assert.That(grouping, Is.EquivalentTo(expectedEnumerable));
        }
    }
}